package com.yunhuakeji.wddx.control;

import java.io.InputStream;

import com.yunhuakeji.wddx.impl.IMTarget;
import com.yunhuakeji.wddx.service.TargetService;
import com.yunhuakeji.wddx.utils.ResultUtil;

public class MBController extends ActionTicketSupport
{
	private static final long serialVersionUID = 1L;
	private InputStream inputStream;
	private String callback,type, pagenum, cxtj, pageSize,targetID, targetContent, control,items, username, Devicename,content,bz;
	
	public MBController() throws Exception
	{
		super();
	}

	public String findTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().findTarget(this.getUserid(), type, pagenum, cxtj, pageSize,this.getTicket()));
		return SUCCESS;
	}
	
	public String getMyTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().getMyTarget(this.getUserid(), type,this.getTicket()));
		return SUCCESS;
	}
	
	public String getRandomTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().getRandomTarget(this.getUserid(), this.getTicket()));
		return SUCCESS;
	}
	
	public String getTargetBaseTitle()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().getTargetBaseTitle(this.getUserid(),this.getTicket()));
		return SUCCESS;
	}
	
	public String getTargetBaseTitleApp()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().getTargetBaseTitleWithApp(this.getUserid(),this.getTicket()));
		return SUCCESS;
	}
	
	public String addTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new TargetService().addTargetWithPc(this.getUserid(), targetID,this.getTicket()));
		return SUCCESS;
	}
	
	public String addTargetApp()
	{
		inputStream = new ResultUtil().resultString(callback, new TargetService().addTargetWithApp(this.getUserid(), targetID,this.getTicket()));
		return SUCCESS;
	}
	
	public String addTargetfromSquare()
	{
//		inputStream = new ResultUtil().resultString(callback, new IMTarget().addTargetfromSquare(this.getUserid(), targetID));
		inputStream = new ResultUtil().resultString(callback, new TargetService().addTargetfromSquareWithPc(this.getUserid(), this.getTicket(), targetID));
		return SUCCESS;
	}
	
	public String addTargetfromSquareApp()
	{
		inputStream = new ResultUtil().resultString(callback, new TargetService().addTargetfromSquareWithApp(this.getUserid(), this.getTicket(), targetID));
		return SUCCESS;
	}
	
	public String newAddTarget_teacher()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().newAddTarget_teacher(this.getUserid(), targetContent, control));
		return SUCCESS;
	}
	
	public String newAddTarget_student()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().newAddTarget_student(this.getUserid(), targetContent,this.getTicket()));
		return SUCCESS;
	}
	
	public String myJoinedTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new TargetService().myJoinedTargetWithPc(this.getUserid(), targetID,this.getTicket()));
		return SUCCESS;
	}
	
	public String myNotJoinedTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new TargetService().myNotJoinedTargetWithPc(this.getUserid(), targetID,this.getTicket()));
		return SUCCESS;
	}
	
	public String myNotJoinedTargetApp()
	{
		inputStream = new ResultUtil().resultString(callback, new TargetService().myNotJoinedTargetWithApp(this.getUserid(), targetID,this.getTicket()));
		return SUCCESS;
	}
	
	public String getSignedOfNowDay()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().getSignedOfNowDay(this.getUserid(), targetID));
		return SUCCESS;
	}
	
	public String target_QD()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().target_QD(this.getUserid(), items,this.getTicket()));
		return SUCCESS;
	}
	
	public String getTargetStatisticalData()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().getTargetStatisticalData(this.getUserid(),this.getTicket()));
		return SUCCESS;
	}
	
	public String deleteTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().deleteTarget(this.getUserid(), targetID,this.getTicket()));
		return SUCCESS;
	}
	
	public String RemovedFromTheUserTargetBase()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().RemovedFromTheUserTargetBase(this.getUserid(), targetID,this.getTicket()));
		return SUCCESS;
	}
	
	public String shareTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new TargetService().shareTargetWithPc(this.getUserid(), username, targetID, Devicename,content,this.getTicket()));
		return SUCCESS;
	}
	
	public String shareTargetApp()
	{
		inputStream = new ResultUtil().resultString(callback, new TargetService().shareTargetWithApp(this.getUserid(), username, targetID, Devicename,content,this.getTicket()));
		return SUCCESS;
	}
	
	public String RandomGetMineTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().RandomGetMineTarget(this.getUserid(),this.getTicket()));
		return SUCCESS;
	}
	
	public String GetMineTarget()
	{
		inputStream = new ResultUtil().resultString(callback, new IMTarget().GetMineTarget(this.getUserid(),this.getTicket()));
		return SUCCESS;
	}
	
	public String getTarget(){
		
		inputStream = new ResultUtil().resultString(callback, new IMTarget().getTarget(this.getUserid(), type,this.getTicket()));
		return SUCCESS;
	}
	
	public String getTargetDetails(){
		
		inputStream = new ResultUtil().resultString(callback, new IMTarget().getTargetDetails(this.getUserid(), targetID, this.getTicket(),bz));
		return SUCCESS;
	}	
	
	public InputStream getInputStream()
	{
		return inputStream;
	}

	public void setInputStream(InputStream inputStream)
	{
		this.inputStream = inputStream;
	}

	public String getCallback()
	{
		return callback;
	}

	public void setCallback(String callback)
	{
		this.callback = callback;
	}

	public String getType()
	{
		return type;
	}

	public void setType(String type)
	{
		this.type = type;
	}

	public String getPagenum()
	{
		return pagenum;
	}

	public void setPagenum(String pagenum)
	{
		this.pagenum = pagenum;
	}

	public String getCxtj()
	{
		return cxtj;
	}

	public void setCxtj(String cxtj)
	{
		this.cxtj = cxtj;
	}

	public String getPageSize()
	{
		return pageSize;
	}

	public void setPageSize(String pageSize)
	{
		this.pageSize = pageSize;
	}

	public String getTargetID()
	{
		return targetID;
	}

	public void setTargetID(String targetID)
	{
		this.targetID = targetID;
	}

	public String getItems()
	{
		return items;
	}

	public void setItems(String items)
	{
		this.items = items;
	}

	public String getTargetContent()
	{
		return targetContent;
	}

	public void setTargetContent(String targetContent)
	{
		this.targetContent = targetContent;
	}

	public String getControl()
	{
		return control;
	}

	public void setControl(String control)
	{
		this.control = control;
	}

	public String getUsername()
	{
		return username;
	}

	public void setUsername(String username)
	{
		this.username = username;
	}

	public String getDevicename()
	{
		return Devicename;
	}

	public void setDevicename(String devicename)
	{
		Devicename = devicename;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public String getBz() {
		return bz;
	}

	public void setBz(String bz) {
		this.bz = bz;
	}

}
